import { Column, Entity, ManyToOne } from 'typeorm';
import { User } from '../../../admin/user/entities/user.entity';
import { CommonEntity } from '../../../../util/entity/common.entity';

@Entity('common_file')
export class File extends CommonEntity {
  @Column({ default: 0, comment: '是否已经使用过 1-使用过 0-未使用' })
  used: number;
  @Column({ comment: '哪一个文件夹' })
  folder: string;
  @Column({ comment: '文件路径,短路径' })
  shorUrl: string;
  @Column({ comment: '文件路径,完整路径' })
  fullUrl: string;
  @Column({ unique: true, comment: '文件的hash' })
  hash: string;
  @Column({ comment: '文件大小' })
  size: number;

  // user暂时没用
  @ManyToOne(() => User)
  user: User;
}
